-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] MailMakeCommand: Add new --view
option
#51411
Conversation
Could a maintainer mark this as draft please so it doesn't show up on Taylor's feed? I still need to write tests :^) |
@ryangjchandler you can do that on the right sidebar "Still in progress? Mark as draft" |
Has that button moved or something cause I could swear it used to show up on the bottom for me! Thanks :^) |
|
||
$stub = str_replace( | ||
'{{ quote }}', | ||
Inspiring::quotes()->random(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably remove this since you're not actually using {{ quote }}
anywhere in the stubs, not to mention an inspiring quote being injected into the mailable template makes no sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahinkle ah nice I for some reason didn't realize it was the view stub being used, I thought it was one of the ones in the PR. Thanks!
$stub = str_replace( | ||
'{{ quote }}', | ||
Inspiring::quotes()->random(), | ||
file_get_contents(__DIR__ . '/stubs/view.stub') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated blade view stub here has a <div>
in it. Wouldn't that be a little strange for emails? We might need a new mailable view stub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought about adding a new stub for this but kept it simple for now and re-used the existing view.stub
file. Will await feedback from others too :^)
Co-authored-by: Mior Muhammad Zaki <crynobone@gmail.com>
This pull request adds a new
--view
option to themake:mail
command that will create a new empty Blade file and configure theMailable
to use it by default.It behaves the same way as the existing
--markdown
option.I imagine this would be a nice and small workflow optimisation for folks, including myself. I'm always creating new Blade views for regular HTML emails and manually updating the
Mailable
.